home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
SGI Developer Toolbox 6.1
/
SGI Developer Toolbox 6.1 - Disc 3.iso
/
bin
/
startOKServer
< prev
next >
Wrap
Text File
|
1996-11-11
|
1KB
|
74 lines
#!/bin/csh -f
#
# update path to also look in the same directory from
# where this script was executed from
#
set path = (/usr/bsd /bin /usr/bin /usr/sbin /usr/bin/X11)
set DT_xconfirm = "$DT_utilities/DT_xconfirm"
set path = (${DT_util_path} $path)
# make sure CDROM_ROOT envariable is set
if (! $?CDROM_ROOT) then
$DT_xconfirm notviewDT
exit 0
endif
#
# find out and remember the user name
#
if ($?HOME) then
set userHome = $HOME
else
$DT_xconfirm nohome
endif
#
# establish a free port number for the OK server
#
#
# see if it is locked by someone else
#
while ( -e /tmp/.portlock )
echo "Obtaining a port number for dt_oksvr (Search Server), please wait"
sleep 1
end
# lock the port number until the server actually starts
/usr/bin/mkdir /tmp/.portlock
/usr/bin/chmod og-r /tmp/.portlock
set sockPort = `getFreePortNumber 6005`
if ($sockPort == -1) then
$DT_xconfirm error "Could not find a free port for OKSERVER."
exit 0
endif
#
# store it in a file
#
/usr/bin/touch $userHome/$DT_WWW_ROOT/logs/oksrv.port
echo $sockPort > $userHome/$DT_WWW_ROOT/logs/oksrv.port
echo "dt_oksvr (Search Server): port $sockPort"
setenv OKSVR_PORT $sockPort
#
# invoke ok server
#
okserver start
#
# unlock, for race conditions for port number
#
/usr/bin/rm -rf /tmp/.portlock
exit 1